﻿using RndMaterialDisposalService.Models;
using RndMaterialDisposalService.Models.Entitys;
using RndMaterialDisposalService.Models.RequestModel;
using Microsoft.EntityFrameworkCore.Infrastructure;

namespace RndMaterialDisposalService.Services.Interface
{
    /// <summary>
    /// 
    /// </summary>
    public interface IERPAssetInfoService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="assetInfoReq"></param>
        /// <returns></returns>
        Task<(List<ERPAssetInfoModel> Data, int TotalCount)> GetERPAssetInfo(ERPAssetInfoReq assetInfoReq);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="bookType"></param>
        /// <param name="pageNum"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(List<ERPAssetInfoModel> Data, int TotalCount)> GetAssetInfoByKeyword(string? keyword, string? bookType, int pageNum = 1, int pageSize = 10);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        Task<int> SyncERPAssetData();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<List<object>> ExecSqlQuery(string sql);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<int> ExecSqlUpdate(string sql);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<List<object>> K2ExecSqlQuery(string sql);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        Task<int> K2ExecSqlUpdate(string sql);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(List<ProjectInfoDto> Data, int TotalCount)> GetProjectInfoByKeyword(string? keyword, int pageIndex = 1, int pageSize = 10);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(List<ProductModelDto> Data, int TotalCount)> GetProductModelByKeyword(string? keyword, int pageIndex = 1, int pageSize = 10);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="projectCode"></param>
        /// <returns></returns>
        Task<List<ProductModelDto>> ProductModelByPrjcode(string projectCode);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<(List<ERPDeviceInfoDto> Data, int TotalCount)> GetERPDeviceInfoByKeyword(string? keyword, int pageIndex = 1, int pageSize = 10);
    }
}
